Skip to content
  • 0 Votes
    1 Posts
    200 Views
    No one has replied
  • 0 Votes
    15 Posts
    2k Views
    M

    I can solve the problem. First, I created folder sqldrivers including libqsqlite.so in the app directory (e.x. /data/user/0/com.example.polarislib) and I set permission by chmod 777 to sqldrivers folder and libqsqlite.so file and finally I used the following code in my source where the connection to Sqlite is needed:

    QCoreApplication::addLibraryPath("/data/user/0/com.example.polarislib");
  • 0 Votes
    3 Posts
    2k Views
    A

    Hello,

    Sorry for the novice mistake! I was trying to use different compilers in the NDK but i end up with the same error. The code i uploaded before was from one of my trials.
    I did change my configuration to x86 but i still get the same error. Since this is my 1st time for android, I may have missed something.

    The error stays the same. The 1st few line of my cmake error log states:

    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-g++ Build flags: Id flags: The output was: 1 /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtend_android.o: No such file or directory /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lstdc++ /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lm /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lc /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -ldl collect2: error: ld returned 1 exit status

    and the cmake output states

    -- The CXX compiler identification is GNU 4.9.0 -- Check for working CXX compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -- Check for working CXX compiler: /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -- broken CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:54 (message): The C++ compiler "/home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_c05c5/fast" /usr/bin/make -f CMakeFiles/cmTC_c05c5.dir/build.make CMakeFiles/cmTC_c05c5.dir/build make[1]: Entering directory '/home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -o CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o -c /home/user/testProjects/build-bubbleWork-Android_for_x86_GCC_4_9_Qt_5_9_3_for_Android_x86-Default/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_c05c5 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c05c5.dir/link.txt --verbose=1 /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc CMakeFiles/cmTC_c05c5.dir/testCXXCompiler.cxx.o -o cmTC_c05c5 -rdynamic /home/user/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    Glad you found out and thanks for sharing !

    Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

  • 0 Votes
    5 Posts
    9k Views
    SandersS

    I finally found my issue. My include path did not point to the great folder (the one containing the QObject header)

    To fix it I used the include path flag with the ndk-build command

  • 0 Votes
    2 Posts
    996 Views
    SGaistS

    Hi,

    You should add which OS you are using, what version of the Android NDK and SDK you are trying to use.

  • 0 Votes
    3 Posts
    2k Views
    L

    @benlau
    Thanks,
    it probably depend on QtActivity that set something as you said but can't find the solution...